package com.health_predict_springboot.service.impl;

import com.health_predict_springboot.dao.SysExportRecordMapper;
import com.health_predict_springboot.pojo.SysExportRecord;
import com.health_predict_springboot.service.SysExportRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SysExportRecordServiceImpl implements SysExportRecordService {

    @Autowired
    private SysExportRecordMapper sysExportRecordMapper;

    @Override
    public SysExportRecord getExportRecordById(Integer recordId) {
        return sysExportRecordMapper.selectByRecordId(recordId);
    }

    @Override
    public List<SysExportRecord> getExportRecordsByUserId(Integer userId) {
        return sysExportRecordMapper.selectByUserId(userId);
    }

    @Override
    public List<SysExportRecord> getAllExportRecords() {
        return sysExportRecordMapper.selectAllExportRecords();
    }

    @Override
    public boolean addExportRecord(SysExportRecord exportRecord) {
        return sysExportRecordMapper.insertExportRecord(exportRecord) > 0;
    }

    @Override
    public boolean updateExportRecord(SysExportRecord exportRecord) {
        return sysExportRecordMapper.updateExportRecord(exportRecord) > 0;
    }

    @Override
    public boolean deleteExportRecord(Integer recordId) {
        return sysExportRecordMapper.deleteExportRecord(recordId) > 0;
    }

    @Override
    public List<SysExportRecord> getExportRecordsByPage(Map<String, Object> params) {
        return sysExportRecordMapper.selectExportRecordsByPage(params);
    }

    @Override
    public int getExportRecordCount(Map<String, Object> params) {
        return sysExportRecordMapper.selectExportRecordCount(params);
    }
}